package com.runshu.newsmartark.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Demo class
 *
 * @author yu
 * @date 2021/11/19
 * @decs：
 */

public class CheckInventoryEntity implements Parcelable {


    private Integer changeNum;
    private boolean isAdd;
    private List<ListBean> list;
    private Integer sumNum;

    public Integer getChangeNum() {
        return changeNum;
    }

    public void setChangeNum(Integer changeNum) {
        this.changeNum = changeNum;
    }

    public boolean getIsAdd() {
        return isAdd;
    }

    public void setIsAdd(boolean isAdd) {
        this.isAdd = isAdd;
    }

    public List<ListBean> getList() {
        return list;
    }

    public void setList(List<ListBean> list) {
        this.list = list;
    }

    public Integer getSumNum() {
        return sumNum;
    }

    public void setSumNum(Integer sumNum) {
        this.sumNum = sumNum;
    }

    public static class ListBean implements Parcelable {
        private boolean isAdd;
        private String stockNum;
        private String customerId;
        private String hospitalId;
        private String goodsId;
        private String goodsName;
        private String goodsModel;
        private String userName;

        public boolean getIsAdd() {
            return isAdd;
        }

        public void setIsAdd(boolean isAdd) {
            this.isAdd = isAdd;
        }

        public String getStockNum() {
            return stockNum;
        }

        public void setStockNum(String stockNum) {
            this.stockNum = stockNum;
        }

        public String getCustomerId() {
            return customerId;
        }

        public void setCustomerId(String customerId) {
            this.customerId = customerId;
        }

        public String getHospitalId() {
            return hospitalId;
        }

        public void setHospitalId(String hospitalId) {
            this.hospitalId = hospitalId;
        }

        public String getGoodsId() {
            return goodsId;
        }

        public void setGoodsId(String goodsId) {
            this.goodsId = goodsId;
        }

        public String getGoodsName() {
            return goodsName;
        }

        public void setGoodsName(String goodsName) {
            this.goodsName = goodsName;
        }

        public String getGoodsModel() {
            return goodsModel;
        }

        public void setGoodsModel(String goodsModel) {
            this.goodsModel = goodsModel;
        }

        public String getUserName() {
            return userName;
        }

        public void setUserName(String userName) {
            this.userName = userName;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeByte(this.isAdd ? (byte) 1 : (byte) 0);
            dest.writeString(this.stockNum);
            dest.writeString(this.customerId);
            dest.writeString(this.hospitalId);
            dest.writeString(this.goodsId);
            dest.writeString(this.goodsName);
            dest.writeString(this.goodsModel);
            dest.writeString(this.userName);
        }

        public void readFromParcel(Parcel source) {
            this.isAdd = source.readByte() != 0;
            this.stockNum = source.readString();
            this.customerId = source.readString();
            this.hospitalId = source.readString();
            this.goodsId = source.readString();
            this.goodsName = source.readString();
            this.goodsModel = source.readString();
            this.userName = source.readString();
        }

        public ListBean() {
        }

        protected ListBean(Parcel in) {
            this.isAdd = in.readByte() != 0;
            this.stockNum = in.readString();
            this.customerId = in.readString();
            this.hospitalId = in.readString();
            this.goodsId = in.readString();
            this.goodsName = in.readString();
            this.goodsModel = in.readString();
            this.userName = in.readString();
        }

        public static final Creator<ListBean> CREATOR = new Creator<ListBean>() {
            @Override
            public ListBean createFromParcel(Parcel source) {
                return new ListBean(source);
            }

            @Override
            public ListBean[] newArray(int size) {
                return new ListBean[size];
            }
        };
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.changeNum);
        dest.writeByte(this.isAdd ? (byte) 1 : (byte) 0);
        dest.writeList(this.list);
        dest.writeValue(this.sumNum);
    }

    public void readFromParcel(Parcel source) {
        this.changeNum = (Integer) source.readValue(Integer.class.getClassLoader());
        this.isAdd = source.readByte() != 0;
        this.list = new ArrayList<ListBean>();
        source.readList(this.list, ListBean.class.getClassLoader());
        this.sumNum = (Integer) source.readValue(Integer.class.getClassLoader());
    }

    public CheckInventoryEntity() {
    }

    protected CheckInventoryEntity(Parcel in) {
        this.changeNum = (Integer) in.readValue(Integer.class.getClassLoader());
        this.isAdd = in.readByte() != 0;
        this.list = new ArrayList<ListBean>();
        in.readList(this.list, ListBean.class.getClassLoader());
        this.sumNum = (Integer) in.readValue(Integer.class.getClassLoader());
    }

    public static final Parcelable.Creator<CheckInventoryEntity> CREATOR = new Parcelable.Creator<CheckInventoryEntity>() {
        @Override
        public CheckInventoryEntity createFromParcel(Parcel source) {
            return new CheckInventoryEntity(source);
        }

        @Override
        public CheckInventoryEntity[] newArray(int size) {
            return new CheckInventoryEntity[size];
        }
    };
}